<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
	<title></title>
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/css/common.css">
</head>
<body>
	<div class='status'><span>添加货品</span><a class='back' href="<?php echo U('index');?>"><strong>返回商品列表<b></b></strong></a></div>
	<form method='post' action="<?php echo U(addItem);?>">
	<table class="table">
		<tr>
			<th>ID</th>
			<?php if(is_array($typeName)): foreach($typeName as $key=>$v): ?><th><?php echo ($v["name"]); ?></th><?php endforeach; endif; ?>
			<th>库存</th>
			<th>货号</th>
			<th>操作</th>
		</tr>
			<?php if(is_array($list)): foreach($list as $key=>$v): ?><tr>
					<td><?php echo ($v["id"]); ?></td>
					<?php if(is_array($v["attr"])): foreach($v["attr"] as $key=>$value): ?><td><?php echo ($value["value"]); ?></td><?php endforeach; endif; ?>
					<td><?php echo ($v["inventory"]); ?></td>
					<td><?php echo ($v["number"]); ?></td>
					<td><a href="<?php echo U('updateItem',array('id'=>$v['id'],'gid'=>$_GET['gid']));?>">修改</a><a href="<?php echo U('delItem',array('id'=>$v['id']));?>">删除</a></td>
				</tr><?php endforeach; endif; ?>	
		<tr>
			<td>添加</td>
			<?php if(is_array($spec)): foreach($spec as $key=>$v): ?><td>
				<select class='select' name='attr[]'>
					<option>请选择</option>
					<?php if(is_array($v)): foreach($v as $key=>$i): ?><option value='<?php echo ($i["id"]); ?>'><?php echo ($i["value"]); ?></option><?php endforeach; endif; ?>
				</select>
			</td><?php endforeach; endif; ?>
			<td><input type='text' class='text' name='inventory'/></td>
			<td><input type='text' class='text' name='number'/></td>
			<td>
				<input type='hidden' name='gid' value="<?php echo ($_GET['gid']); ?>"/>
				<input type='submit' value='添加货品' class='add_btn'/>
			</td>
		</tr>
	</table>
	</form>

</body>
</html>